package day6;
// 父类：把所有子类共同的特征抽取到父类里面
// 如果一个类没有继承任何一个类，默认会继承Object，你不写java默认也会加上
// Student extends Preson因为是单继承的，所以就不会Object
public class Person {
	// protexted为了让子类也能访问到
	protected int id;
	protected String name;
	protected int age;
	protected String gender;
	
	protected void run() {
		System.out.println("Person.run()");
	}
// public 方法子类能继承	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	@Override
	public String toString() {
		return "Person [id=" + id + ", name=" + name + ", age=" + age + ", gender=" + gender + "]";
	}
	
}
